<template>
  <v-md-editor
    v-show="modelValue.show"
    v-model="modelValue.text"
    height="600px"
  ></v-md-editor>
</template>

<script lang="ts" setup generic="T extends object & { text:string;show:boolean}">
import { computed, onMounted } from "vue";

onMounted(() => {
  setTimeout(() => {
    modelValue.value.show = true;
  }, 500);
});

const props = defineProps<{ modelValue: T }>();
const emit = defineEmits(["update:modelValue"]);
const modelValue = computed({
  get: () => props.modelValue,
  set: val => emit("update:modelValue", val),
});
</script>
